import request from '@/utils/request'

/**
 * 获取部门人数
 * @returns 
 */
 export function findDeptAndCount(){
  return request({
    url : '/department/findDeptAndCount',
    method : 'get',
  
  })
}

/**
 * 查询部门
 */
export function getDeptList(DeptVO){
  return request({
    url: '/department/getDeptList',
    method: 'post',
    data: DeptVO
  })
}

/**
 * 添加部门
 * @param {} department 
 * @returns 
 */
export function addDept(department){
  return request({
    url: '/department/addDept',
    method: 'post',
    data: department
  })
}

/**
 * 修改部门
 * @param {} department 
 */
export function updateDept(department){
  return request({
    url: '/department/updateDept',
    method: 'put',
    data: department
  })
}

/**
 * 删除部门
 * @param {} id 
 * @returns 
 */
export function deleteDept(id){
  return request({
    url: '/department/deleteDept',
    method: 'delete',
    params:{
      id
    }
  })
}

/**
 * 导出部门信息到excel中
 * @returns 
 */
export function downDeptExcel(){
  return request({
    url: '/department/excel',
    method: 'post',
    responseType: 'blob'
  })
}